package com.gitee.xhs.dao;

import com.gitee.xhs.sampleRecod.transactionRecord.Transaction;

/**
 * @author BigHead
 * @date 2022/7/21 9:56
 * @description IntervalJoinDao
 */
public class IntervalJoinDao {

    private Transaction leftTransaction;
    private Transaction rightUpperTransaction;
    private Transaction rightEqualTransaction;
    private Transaction rightLowerTransaction;

    public Transaction getLeftTransaction() {
        return leftTransaction;
    }

    public void setLeftTransaction(Transaction leftTransaction) {
        this.leftTransaction = leftTransaction;
    }

    public Transaction getRightUpperTransaction() {
        return rightUpperTransaction;
    }

    public void setRightUpperTransaction(Transaction rightUpperTransaction) {
        this.rightUpperTransaction = rightUpperTransaction;
    }

    public Transaction getRightEqualTransaction() {
        return rightEqualTransaction;
    }

    public void setRightEqualTransaction(Transaction rightEqualTransaction) {
        this.rightEqualTransaction = rightEqualTransaction;
    }

    public Transaction getRightLowerTransaction() {
        return rightLowerTransaction;
    }

    public void setRightLowerTransaction(Transaction rightLowerTransaction) {
        this.rightLowerTransaction = rightLowerTransaction;
    }

    public void merge(IntervalJoinDao intervalJoinDao) {
        if (null != intervalJoinDao.rightUpperTransaction) {
            this.rightUpperTransaction = intervalJoinDao.rightUpperTransaction;
        }
        if (null != intervalJoinDao.rightEqualTransaction) {
            this.rightEqualTransaction = intervalJoinDao.rightEqualTransaction;
        }
        if (null != intervalJoinDao.rightLowerTransaction) {
            this.rightLowerTransaction = intervalJoinDao.rightLowerTransaction;
        }
    }

    @Override
    public String toString() {
        return "IntervalJoinDao{" +
                "leftTransaction=" + leftTransaction +
                ", rightUpperTransaction=" + rightUpperTransaction +
                ", rightEqualTransaction=" + rightEqualTransaction +
                ", rightLowerTransaction=" + rightLowerTransaction +
                '}';
    }
}
